Skip to content

docs: clarify auto-variadic socket input ordering in connect()#11053

Merged
sjrl merged 4 commits intodeepset-ai:mainfrom
saivedant169:docs/variadic-ordering
Apr 21, 2026
Merged

docs: clarify auto-variadic socket input ordering in connect()#11053
sjrl merged 4 commits intodeepset-ai:mainfrom
saivedant169:docs/variadic-ordering

Conversation

@saivedant169
Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

@julian-risch and @sjrl discussed this in #10979 and went with Option A: keep the current behavior but document it better.

Updated two docstrings in haystack/core/pipeline/base.py:

  1. Pipeline.connect() now mentions that when multiple senders are connected to the same list-typed receiver socket, the items in the resulting list end up ordered alphabetically by sender component name, not by the order connect() was called. Users who need a specific order should use a dedicated joiner component like DocumentJoiner.

  2. _make_socket_auto_variadic() got the same note plus a sentence explaining the underlying reason: Pipeline.run() schedules components in alphabetical order so that execution stays deterministic and independent of pipeline insertion order.

Also added a release note under releasenotes/notes/.

How did you test it?

This is a docs-only change. No new tests needed. Verified the file still parses cleanly with ruff.

Notes for the reviewer

I couldn't run hatch run fmt locally because hatch wasn't installed in my environment, but I ran ruff directly on the modified file and it passes (ruff check and ruff format --check both clean).

Happy to tweak the wording if you want it phrased differently.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings. (docstrings only, no tests)
  • I've used one of the conventional commit types for my PR title: docs:
  • I have documented my code.
  • I have added a release note file.
  • I have run pre-commit hooks and fixed any issue. (ran ruff directly, pre-commit/hatch not available locally)

@saivedant169 saivedant169 requested a review from a team as a code owner April 8, 2026 01:47
@saivedant169 saivedant169 requested review from davidsbatista and removed request for a team April 8, 2026 01:47
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

@saivedant169 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 8, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added topic:core type:documentation Improvements on the docs labels Apr 8, 2026
Comment thread haystack/core/pipeline/base.py Outdated
@sjrl sjrl requested review from sjrl and removed request for davidsbatista April 9, 2026 06:34
@sjrl
Copy link
Copy Markdown
Contributor

sjrl commented Apr 9, 2026

@davidsbatista I can take the review of this one

@sjrl sjrl self-assigned this Apr 9, 2026
Document the input ordering behavior of auto-promoted lazy variadic
sockets in Pipeline.connect() and PipelineBase._make_socket_auto_variadic().
When multiple senders are connected to the same list-typed receiver
socket, the items in the resulting list are ordered alphabetically by
sender component name (because Pipeline.run() schedules components in
alphabetical order for deterministic execution), not by the order in
which connect() was called.

The docstrings now point users to a dedicated joiner component when
they need explicit ordering.

fixes deepset-ai#10979
Applied sjrl's review feedback. The previous text was wrong about
DocumentJoiner (it behaves the same as a promoted variadic socket) and
it missed the difference between Pipeline and AsyncPipeline.

Pipeline schedules components alphabetically, so the resulting list is
ordered by sender name. AsyncPipeline runs branches in parallel, so
ordering is not guaranteed. Updated both the connect() docstring and
the _make_socket_auto_variadic note, plus the release note.
@saivedant169 saivedant169 force-pushed the docs/variadic-ordering branch from e7d7ecd to b390210 Compare April 15, 2026 01:46
@saivedant169
Copy link
Copy Markdown
Contributor Author

Thanks for catching that @sjrl. You're right, the DocumentJoiner bit was off and the Pipeline vs AsyncPipeline distinction was missing. I applied your wording in the connect() docstring and propagated the same clarification to the _make_socket_auto_variadic note and the release note so all three read consistently.

Comment thread haystack/core/pipeline/base.py Outdated
Comment thread haystack/core/pipeline/base.py
Switch the inline literals from double to single backticks so they match
how the rest of our api docstrings are written. Double backticks belong
in the release notes, not here.

Also drop the note block from the private _make_socket_auto_variadic
helper. That method is not exposed on the docs site, so the extra context
does not buy users anything. The public-facing explanation on connect()
is enough.
@saivedant169
Copy link
Copy Markdown
Contributor Author

Thanks for the pointers. Switched the inline literals in connect() over to single backticks and dropped the note block from _make_socket_auto_variadic since that method isn't on the docs site. Let me know if anything else stands out.

Comment thread releasenotes/notes/document-variadic-input-ordering-530d8feee4a1b900.yaml Outdated
Copy link
Copy Markdown
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Preview Apr 21, 2026 6:45am

Request Review

@sjrl sjrl enabled auto-merge (squash) April 21, 2026 06:45
@sjrl sjrl merged commit 8996e48 into deepset-ai:main Apr 21, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:core type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alphabetical ordering of auto-joined variadic inputs is unintuitive

3 participants